import requests
headers ={
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
}
url = 'https://www.baidu.com/s?wd=%E7%99%BE%E5%BA%A6%E7%83%AD%E6%90%9C&sa=ire_dl_gh_logo_texing&rsv_dl=igh_logo_pc'
response = requests.get(url=url,headers=headers)

with open('百度.html', 'wb') as f:
    print(len(response.content))
    print('开始写入')
    f.write(response.content)
    print('写入完成')
